//
//  LS_SearchProduceViewController.m
//  yiYuanDuoBao
//
//  Created by 罗李苏 on 16/11/28.
//  Copyright © 2016年 罗李苏. All rights reserved.
//

#import "LS_SearchProduceViewController.h"
#import "LS_SearchView.h"
@interface LS_SearchProduceViewController ()<LS_SearchViewDelegate>

@end

@implementation LS_SearchProduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
//    LS_SearchView *searchView = [[LS_SearchView alloc] initWithFrame:CGRectMake(16, 26, SCREEN_WIDTH, 44)];
    LS_SearchView *searchView = [[LS_SearchView alloc] initWithFrame:CGRectMake(16, 26,SCREEN_WIDTH - 16, 40)];
    [searchView.cancelBtn addTarget:self action:@selector(cancelBtnDidClick:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:searchView];
    
    searchView.placeHolder = @"搜索商品";
    searchView.searchBarColor = [UIColor colorWithRed:205 / 255.0  green:235 / 255.0 blue:206 / 255.0 alpha:1.0f];
//    searchView.searchBarColor = [UIColor grayColor];
    searchView.textColor = [UIColor blueColor];
    searchView.searchBarFont = [UIFont systemFontOfSize:15.0];
    searchView.placeHoldersColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:1.0f];
    searchView.placeHolderFont = [UIFont systemFontOfSize:15.0f];
    searchView.delegate = self;
    [self.view addSubview:searchView];

}
- (void)cancelBtnDidClick:(UIButton *)sender{

    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

#pragma mark 点击搜索框上的删除按钮
- (void)searchBarCancelButtonClicked:(LS_SearchView *)searchBar{

    //删除输入的内容
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
